'''
Created on 21 nov. 2014

@author: geoff

Classe de tests basiques, sans utilisation de bdd, avec NoseTests
'''

from modele import Voiture, Client, Camera, Parking
import sys

v1 = Voiture.Voiture("23", "88", "abc001")

def testVoiture():
    assert v1.getEstGaree() == False
    assert v1.getLongueur() == "23"
    assert v1.getLargeur() == "88"
    v1.garer()
    assert v1.getEstGaree() == True
    v1.sortir()
    assert v1.getEstGaree() == False

def testClient():
    c1 = Client.Client(v1, "dupont", "michel", "3 av du bresil", "bla@gmail.com", "567890", 1, 1)
    assert c1.getId() == 1
    assert c1.getPrenom() == "michel"
    assert c1.getNbFrequentations() == 1
    c1.recevoirTicket()
    assert c1.getNbFrequentations() == 2

def testCamera():
    cam = Camera.Camera()
    cam.setActivationOn()
    image = cam.capturerImage(v1)
    assert image.getLongueur() == "23"
    assert image.getLargeur() == "88"
    assert image.getImmatriculation() == "abc001"
    cam.setActivationOff()

def testParking():
    park = Parking.Parking("ctrl", 3, 2, 2.3, False) #ctrlBdd inutile pr les tests, False = nouv Parking
    assert park.getNbNiveaux() == 3
    assert park.getNbPlacesCapacite() == 3 * 2
    assert park.getNbAcces() == 2
